# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-alive-progress
pkgver=3.1.5
pkgrel=1
pkgdesc="A new kind of Progress Bar, with real-time throughput"
url="https://github.com/rsalmei/alive-progress"
arch="noarch"
license="MIT"
depends="python3 py3-about-time py3-grapheme"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-click py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver-2.tar.gz::https://github.com/rsalmei/alive-progress/archive/v$pkgver.tar.gz
	fix-license.patch
	"
builddir="$srcdir/alive-progress-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
d5da8ad625631865a94fbcb1a30c46773d77bfa642fa527a0adaf9bb8198a64d6f6d572326a2b40589ec127bee6d6c4afc9683c3343dfa42c55f33dde41d02af  py3-alive-progress-3.1.5-2.tar.gz
3aec0c6907027eb699aa6bb78420bc2c213e5157aad7079586d8915e70f20c0e63b52d7eb1171fdd6a8a1bb397e61c216919c7d45b4a104479d64f95ac0541e9  fix-license.patch
"
